function [X]=RunGrouse(X,Startnum,size_arr,M_true0)
maxCycles = 20;        	step_size = 0.1;     	
truerank = 10;          maxrank = truerank+5;               %upper bound for the rank

[X_1,X_2,X_3]=Unfolding(X);

        Uinit=M_true0.U{1};
        [Usg1, Vsg1] = grouse(X_1,size_arr(2),maxCycles,step_size,maxrank,Startnum,Uinit);
        X_temp=(Usg1*Vsg1');     
        if (Startnum==-1)
            X_temp=X_temp(:,end-size_arr(2)+1:end);
        else
            X_temp=X_temp(:,Startnum+1:end);
        end
 
        Uinit=M_true0.U{2};
        [Usg2, Vsg2]=grouse(X_2,size_arr(1),maxCycles,step_size,maxrank,Startnum,Uinit);
        Y_temp=(Usg2*Vsg2');        
        if (Startnum==-1)
            Y_temp=Y_temp(:,end-size_arr(1)+1:end)';
        else
            Y_temp=Y_temp(:,Startnum+1:end)';
        end

        Uinit=M_true0.U{3}(1:size(X_3,1),:);      
        Startnum=-1;
        [Usg3, Vsg3]=grouse(X_3,size_arr(3),maxCycles,step_size,maxrank,Startnum,Uinit);
        T_temp=(Usg3*Vsg3');        
        T_temp=T_temp(end,:);       
        T_temp=reshape(T_temp,[size(X_1,1),size(X_2,1)]);

        M=(1/3)*(X_temp+Y_temp+T_temp);
        X(:,:,end)=M;
end